package de.baumann.browser.activitys.node

import android.content.Context
import android.content.Intent
import de.baumann.browser.R
import de.baumann.browser.base.BaseOdinActivity
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.IBaseView
import de.baumann.browser.utils.Constants
import de.baumann.browser.utils.ViewUtil
import kotlinx.android.synthetic.main.activity_create_node_rule.*
import kotlinx.android.synthetic.main.include_tool_bar.*


/**
 *@author:
 *@date:2019/9/25 15:51
 *@discription: 节点创建规则
 */
@Deprecated("5.0.0版本之后活动结束，不再适用")
class CreateNodeRuleActivity : BaseOdinActivity<IBaseView, BasePresenter<IBaseView>>() {

    override fun createPresenter(): BasePresenter<IBaseView>? {
        return null
    }

    override fun createView(): IBaseView? {
        return null
    }

    companion object {
        fun startCreateNodoRuleActivity(context: Context) {
            context.startActivity(Intent(context, CreateNodeRuleActivity::class.java))
        }
    }

    override fun getTitleText(): String {
        return "创建节点"
    }

    override fun getLayout(): Int {
        return R.layout.activity_create_node_rule
    }

    override fun initView() {
        initToolbar(commToolBar,commTitle)

        ViewUtil.configWebView(webviewNodeRule)

        btnCreateNodeNext.setOnClickListener {
            if (cbNodeRole.isChecked) {
                CreateNodeActivity.startCreateNodeActivity(mContext)
                finish()
            } else {
                showShortToast("请阅读并同意创建规则")
            }
        }
    }

    override fun initData() {
        webviewNodeRule.loadUrl(Constants.NODE_ROLE_URL)
    }
}
